#ifndef NW_CLIENT_STRUCT_H_
#define NW_CLIENT_STRUCT_H_

typedef unsigned char uint8;
typedef unsigned short int uint16;
typedef unsigned int uint32;

#define PRO_MAX_DATA (500U)
#define MAX_PRPRECVDATA_LEN (500U)
#define OBJADDR_LEN 3


enum
{
	E_COSTMODE_TIP = 1,
	E_COSTMODE_PEAK,
	E_COSTMODE_NORMAL,
	E_COSTMODE_VALLEY,
};
//TIP，   //尖
//PEAK,   //峰
//NOMAL,  //平
//VALLEY, //谷

enum
{
	 E_START_BYREMOTE = 0,//通过远程启动
	 E_START_BYCARD ,//通过刷卡启动
	 E_START_BYVIN,//通过VIN启动
};
enum
{
	E_CHARGING_BYAUTO = 0,//自然充满
	E_CHARGING_BYPOWER,//按电量充
	E_CHARGING_BYTIME,//按时间充
	E_CHARGING_BYMONEY,//按金额充
};
enum
{
	 E_END_BY_NONE = 0,//
   E_END_BY_SWIPCARD ,//本地刷卡终止，
   E_END_BY_REMOTE,//远程终止充电，
   E_END_BY_AUTO,//充满自动停止，
   E_END_BY_NOMONEY,//4.余额不足，
   E_END_BY_DEVALARM,//5.充电桩故障，
   E_END_BY_BMS_ALARM,//6.BMS 故障
   E_END_BY_STOPBUTTON,//7.急停按钮停止
   E_END_BY_AUTHCODE,//8.验证码停止，
   E_END_BY_LOSTPOWER,//9.停电结束，
   E_END_BY_POWER,//10.按电量满足结束，
   E_END_BY_MONEY,//11.按金额满足结束，
   E_END_BY_TIME,//12.按时间满足结束，
   E_END_BY_GUNM,//13.拔枪结束
   E_END_BY_OVERVOLTAGE,//14.过压；
   E_END_BY_LOWVOLTAGE,//15.欠压；
   E_END_BY_OVERCURRENT,//16.过流；
   E_END_BY_LOWCURRENT,//17.失流；
   E_END_BY_PE,//18.接地不良；
   E_END_BY_GUI,//19.桩屏幕停止；
   E_END_BY_DEVOVERTEMP,//20.充电桩过温；
   E_END_BY_GUNOVERTEMP,//21.充电枪过温；
   E_END_BY_BATTOVERTEMP,//22.车辆电池过温；
   E_END_BY_GUNLOCK,//23.枪加锁失败；
   E_END_BY_OTHER = 255,//255：其他，
};

enum
{
	 E_START_FLAG_COMFIRE = 0,//确认
	 E_START_FLAG_SUCC,//成功
	 E_START_FLAG_FAIL,//失败
};
enum
{
	 E_START_FAIL_DEVNOTCONN = 0,//设备未连接
	 E_START_FAIL_DEVCONN_ERR,//设备连接故障
	 E_START_FAIL_BMSCONN_ERR,//BMS通信故障
	 E_START_FAIL_SM4_ERR,//SM4密钥错误
	 E_START_FAIL_COSTMODE_ERR,//计费模型异常
	 E_START_FAIL_MONEY_ERR,//余额不足
	 E_START_FAIL_START_TIMEOUT,//启动超时
	 E_START_FAIL_STOPBUTTON,//急停按下
	 E_START_FAIL_DEVALARM,//设备故障
	 E_START_FAIL_BMS_ERR,//BMS异常
	 E_START_FAIL_INSULUTION_ERR,//绝缘故障
	 E_START_FAIL_AC,//接触器合闸失败
	 E_START_FAIL_CHARGING,//充电桩正在充电
	 E_START_FAIL_OVER_V,//过压
	 E_START_FAIL_LOW_V,//欠压
	 E_START_FAIL_UPDATE,//正在远程升级
	 E_STATE_FAIL_CHARGINGPARA_ERR,//带充电参数为0
	 E_START_FAIL_FULL,//车已经充满
	 E_START_FAIL_ELEC_ERR,//电表通信故障
	 E_START_FAIL_MODULE_ERR,//整流模块故障
	
	 E_START_FAIL_OTH34 = 255,//其他故障
	 
};
enum
{
	 E_ENDFLAG_SUCC = 0x00,
	 E_ENDFLAG_FAIL  = 0xf0,
};
enum
{
	 E_STOPREASON_SM4_ERR = 0X01,
	 E_STOPREASON_DEVNUM_ERR,
	 E_STOPREASON_GUN_ERR,
	 E_STOPREASON_USERID_ERR,
	 E_STOPREASON_AC_ERR,
	 E_STOPREASON_NOCHARGE_ERR,
	 E_STOPREASON_OTHER_ERR = 127
};


enum
{
		E_RECORDFLAG_NORAML = 0,
	  E_RECORDFLAG_MAKEUP,
	  E_RECORDFLAG_OTHER,
};

enum
{
	E_NW_STATE_NONE = 0,//无
	E_NW_STATE_ALARM ,// 0001告警
	E_NW_STATE_IDLE ,//0002待机
	E_NW_STATE_WORK,//0003工作
	E_NW_STATE_UNLINE,//0004离线
	E_NW_STATE_FINISH,//0005完成
	E_NW_STATE_SUSPEND,//0006暂停充电
	E_NW_STATE_ONGUN,//0007已插枪
	E_NW_STATE_RESERVE,//0008预约
	E_NW_STATE_UNUSE,//0009禁用
};

enum
{
    E_CAUSE_PER=1, //周期
    E_CAUSE_BACK=2, //背景扫描
    E_CAUSE_SPONT=3, //突发
    E_CAUSE_INIT=4, //初始化
    E_CAUSE_REQ=5, //请求
    E_CAUSE_ACT=6, //激活
    E_CAUSE_ACT_CON=7, //激活确认
    E_CAUSE_ACT_END=10, //激活终止
    E_CAUSE_CALL_ACK=20, //响应总召
    E_CAUSE_REQ_ENC=21, //请求，加密
    E_CAUSE_COUNT_CALL_ACK=37, //响应计数量召唤
    E_CAUSE_UN_TYPE=44, //未知类型标志
    E_CAUSE_UN_TRANS=45, //未知传送原因
    E_CAUSE_UN_ASDU_ADDR=46, //未知应用服务数据单元公共地址
    E_CAUSE_UN_ASDU_OBJ_ADDR=47 //未知信息对象地址
};

enum
{
    //监测类型
    E_TYPE_M_SP_NA_1 = 1, //不带时标单点信息
    E_TYPE_M_ME_NB_1 = 11,//测量值，标度化值，长度=2字节
    E_TYPE_M_IT_NA_1 = 15, //累积量，不带时标
    E_TYPE_M_RE_NA_1 = 130, //充电业务数据
    E_TYPE_M_MD_NA_1 = 132, //测量值，标度化值，长度>2字节
    E_TYPE_M_JC_NA_1 = 134, //充电设备实时监测数据项

    //控制类型
    E_TYPE_C_IC_NA_1 = 100,  //总召命令
    E_TYPE_C_CI_NA_1 = 101,  //计数量总召命令
    E_TYPE_C_CS_NA_1 = 103,  //时钟同步命令
    E_TYPE_C_SD_NA_1 = 133,  //下发数据项命令

    //私有辅助类命令
    E_TYPE_STARTDT_REQ = 200,
    E_TYPE_STOPDT_REQ = 201,
    E_TYPE_SIGN_IN_ACK = 202,
    E_TYPE_LIVE_MSG_ACK = 203,
};

struct t_pro_recvinfo//协议接收队列
{
    uint32 head;
    uint32 tail;
    uint8 recvlist[MAX_PRPRECVDATA_LEN];//接收队列
};

typedef struct __attribute__ ((__packed__)) cp56time2a
{
    uint16	msec;
    uint8	min	:6;
    uint8	res1	:1;
    uint8	iv	:1;
    uint8	hour	:5;
    uint8	res2	:2;
    uint8	su	:1;
    uint8	mday	:5;
    uint8	wday	:3;
    uint8	month	:4;
    uint8	res3	:4;
    uint8	year	:7;
    uint8	res4	:1;
} cp56time2a;


struct t_nw_promsg//协议信息
{
   uint8 sm4[16];//sm4密钥
   uint8 apcihead;//acpi信息头部
   uint16 sendmsgsn;
   uint16 sendcmdsn;
   uint16 publicaddr;//公共地址0x0001;
   uint16 _sendCnt;//心跳包发送计数
   uint16 _recvCnt;//心跳包接收计数
   struct t_pro_recvinfo recvinfo;//接收队列
};
struct t_ac_alarmdesc//告警描述
{
    uint32 code;
	char desc[100];
};

struct t_nw_pro_init
{
  uint8 head;//头部信息
	uint16 lenth;//帧长度
	uint8  flag;//协议启动标识帧
	uint8 ver;//协议版本
	uint8 costmode_id[8];//计费模型id;
	uint8 devnum[8];//设备编码
	uint8 gun_cnt;//枪口数量
	uint8 chargemode;//充电模式
	uint16 addr;//站地址;
};

/*
struct t_devdata_ac //交流充电桩充电过程实时监控数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 connect_state;
	uint16 work_state;
	uint8 ac_input_v_overalarm;
	uint8 ac_input_v_lowlarm;
	uint8 current_overalarm;
	uint16 output_voltage;
	uint16 output_current;
	uint8  output_relay_state;
	uint32 total_actually_power;
	uint16 voltage_A;
	uint16 voltage_B;
	uint16 voltage_C;
	uint16 current_A;
	uint16 current_B;
	uint16 currenr_C;
	uint8  temp_over_pro;
	uint8  short_circuit_pro;
	uint8  leakage_pro;
	uint8  stopbutton_trigger;
	uint32 elecvalue_outside;
};
*/
/*
struct t_devdata_dc//直流充电桩充电过程实时监控数据
{
  uint8 devnum[8];
	uint8 gunno;
	uint16 output_voltage;
	uint16 output_current;
	uint16 soc;
	uint16 battery_group_mintemp;
	uint16 battery_group_maxtemp;
	uint16 devstate;
	uint8 bms_communcate_alarm;
	uint8 dc_mainline_output_v_overalarm;
	uint8 dc_mainline_output_v_lowalarm;
	uint8 battery_i_overalarm;
	uint8 battery_module_collect_temp_overalarm;
	uint32 dc_actually_total_power;
	uint32 ac_actually_total_power;
	uint8 isconnectbattery;
	uint16 single_battery_maxv;
	uint16 single_battery_minv;
  uint8 dev_connector_alarm;
	uint8 bms_stop;
	uint8 devin_temp_alarm;
	uint8 temp_over_pro;
	uint8 short_circuit_pro;
	uint8 leakage_pro;
	uint8 stopbutton_trigger;
	uint16 dev_input_v;
	uint8 dev_input_v_alarm;
	uint16 voltage_A;
	uint16 voltage_B;
	uint16 voltage_C;
	uint16 current_A;
	uint16 current_B;
	uint16 currenr_C;
	uint32 elecvalue_outside;
	uint16 demand_current;
	uint16 demand_voltage;
	uint16 guntemp_dc+;
	uint16 guntemp_dc-;
};
*/
struct t_up_authdata//上传鉴权数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 cardno[8];
	uint8 password[16];
	uint8 password_input[16];
	uint32 card_remain;
	
	uint16 card_state;
	uint8 carflag[32];
	uint8 costmodeno[8];
	uint8 paycardno[8];
	uint8 auth_paycard_data[8];
};


struct t_up_chargerecord//上传充电记录
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 trade_num[16];
	uint8 paycardno[8];
	uint8 hardcardno[8];
	uint8 time_sharing_cal_flag;
	uint8 begintime[7];
	uint8 endtime[7];
	uint32 tip_start_value;
	uint32 tip_stop_value;
	uint32 peak_start_value;
	uint32 peak_stop_value;
	uint32 normal_start_value;
	uint32 normal_stop_value;
	uint32 valley_start_value;
	uint32 valley_stop_value;
	uint16 caltype;
	uint32 total_start_value;
	uint32 total_stop_value;
	uint32 tip_pcs;
	uint32 tip_power;
	uint32 tip_money;
	uint32 peak_pcs;
	uint32 peak_power;
	uint32 peak_money;
	uint32 normal_pcs;
	uint32 normal_power;
	uint32 normal_money;
	uint32 valley_pcs;
	uint32 valley_power;
	uint32 valley_money;
	uint32 total_power;
	uint16 business_type;
	uint32 money_afterpay;
	uint32 consume_pcs;
	uint32 consume_money;
	uint8 carvin[17];
	uint8 trade_flag;
	uint8 client_terminal_num[6];
	uint32 money_beforepay;
	uint16 wallet_trade_serialnum;
	uint32 trade_money;
	uint8 trade_date[7];
	uint32 fake_num;
	uint8 trade_type_flag;
	uint32 tac;
	uint8 key_ver;
	uint32 terminal_trade_serialnum;
	uint32 server_pcs;
	uint32 server_cost;
	uint32 reserve_pcs;
	uint32 reserve_cost;
  uint32 position_pcs;
	uint32 position_cost;
	uint32 total_eleccost;
	uint8 costmodeid[8];
	uint32 total_cost;
	uint16 endreason;
	uint8 userid[8];
	uint32 tip_server_pcs;
	uint32 tip_server_cost;
	uint32 peak_server_pcs;
	uint32 peak_server_cost;
	uint32 normal_server_pcs;
	uint32 normal_server_cost;
	uint32 valley_server_pcs;
	uint32 valley_server_cost;
	uint8 orderno[8];
};

struct t_down_chargingrecord_ack//上传充电记录应答
{
	uint8 devnum[8];
  uint8 gunno;
	uint8 flag;
  uint8 trade_serialnum[16];
};
struct t_up_blacklist_ack//黑名单下发时上行数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 time[9];
	uint8 flag;
};
struct t_down_blacklist//黑名单下发时下行数据
{
  uint8 devnum[8];
	uint8 gunno;
	uint8 time[9];
	uint8 blacklistnum;
	uint8 cardno[8];
	uint8 state;
	//...一系列
};
struct t_up_require_costmode//请求下发计费模型
{
	uint8 devnum[8];
	uint8 gunno;
};
struct t_down_costmode//服务器下发计费模型
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 costmode_id[8];
	uint8 begintime[7];
	uint8 endtime[7];
	uint16 state;
	uint16 caltype;
	uint8 timenum;
};
struct t_costmodemsg//计费模型信息
{
   uint16 begintime;
   uint8 flag;
   uint32 elec_tip;
   uint32 elec_peak;
   uint32 elec_normal;
   uint32 elec_valley;
   uint32 pcs_server;
   uint32 pcs_position;
   uint32 pcs_reserve;
};
struct t_up_costmode_ack//计费模型结果
{
  uint8 devnum[8];
	uint8 gunno;
	uint8 costmode_id[8];
	uint8 flag;
};
struct t_down_authdata//充电鉴权下行数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 cardno[8];
	uint8 carvin[32];
	uint8 costmodenum[8];
	uint32 reamin_money;
	uint8 authflag;
	uint16 auth_failreason;
	uint32 remain_km;
	uint32 avalib_power;
	uint32 avalib_cnt;
	uint8 orderno[8];
};
struct t_down_paydata//充电扣款后下行数据
{
   uint8 devnum[8];
   uint8 gunno;
   uint8 cardno[8];   
   uint32 paymoney;
   uint32 usermoney;
   uint8 pay_succflag;
   uint16 pay_failreason;
   uint32 pay_km;
   uint32 remain_km;
   uint32 pay_elec;
   uint32 remain_elec;
   uint32 pay_cnt;
   uint32 remain_cnt;
};
struct t_up_doubleauth_data//双向认证终端发起双向认证上行数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 cardno[8];
};
struct t_down_doubleauth_randomdata//双向认证中运营系统下发随机数下行数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 random[8];
};
struct t_up_doubleauth_authdata//双向认证中终端上送认证数据上行数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 terminal_randomnum[8];
    uint8 safemodule_authdata[8];	
};
struct t_down_doubleauth_authdata//双向认证中运营系统下发数据下行数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 flag;
	uint8 auth_data[8];
};
struct t_up_doubleauth_toplat_data//双向认证终端认证运营系统上行数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 flag;
};
struct t_up_trade_randomnum//交易取随机数
{
    uint8 devnum[8];
	uint8 gunno;
};
struct t_down_trade_randomnum_ack//交易取随机数应答
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 random[8];
};
struct t_down_esamkey_update//ESAM密钥更新命令下行数据
{
	 uint8 devnum[8];
	 uint8 gunno;
	 uint16 updateflag;
};
struct t_up_esamkey_normaldata//ESAM密钥更新中基本数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 esam_serialnum[8];
};
struct t_down_esamkey_file1//ESAM加密密钥更新中密钥文件1下发下行数据
{
	uint8 devnunm[8];
	uint8 gunno;
	uint8 key[110];
};
struct t_up_esamkey_file1_ack//ESAM加密密钥更新中密钥文件1接受成功数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 flag;
};
struct t_down_esamkey_file2//ESAM加密密钥更新中密钥文件2下发下行数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 key[110];
};
struct t_up_esamkey_ack//ESAM加密密钥更新中密钥文件2接受成功数据
{
   uint8 devnuum[8];
   uint8 gunno;
   uint8 flag;
};
struct t_down_remote_start//远程启动充电
{
   uint8 devnum[8];	
	 uint8 gunno;
	 uint32 remain;
	 uint8 userid[8];//用户身份id 8位bcd吗
	 uint8 type;//启动方式
	 uint32 value;//启动附带参数 bcd 需要转成asc 所以数组要定大一个字节 
	 uint8 orderno[8];
};
struct t_up_remote_start_ack//远程启动充电执行结果
{
	uint8 devnum[8];
	uint8 gunno;
  uint8 trade_num[16];
	uint8 costmode[8];
	uint8 startway;
	uint8 result;
	uint8 reason;
	uint16 max_total_v;
	uint16 max_total_i;
	uint16 battey_total_power;
	uint8 max_temp;
  uint16 single_battery_max_v;
	uint16 batterynow_v;
	uint8 userid[8];
};
struct t_down_remote_stop//远程终止充电
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 stop[8];
};
struct t_up_remote_stop_ack//远程终止充电应答
{
	uint8 devnum[8];
	uint8 gunno;
  uint8 flag;
};
struct t_down_remote_powercontrol//远程功率控制
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 control_type;
	uint16 control_para;
  uint8 time[7];
};
struct t_up_remote_powercontrol_ack//远程功率控制结果
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 flag;
};
struct t_down_remote_updatestart//远程升级启动
{
	uint8 devnum[8];
	uint8 flag;//有效标志位 0xaa表示有效  其他无效
	uint8 ip[4];//远端升级ip 
	uint8 port;//端口号
	uint8 ftp_user[10];//用户名
	uint8 ftp_password[10];//密码
	uint8 pwd[50];//路径
	uint8 filename[50];//文件名
	uint8 fac_num[10];//厂家编码
	uint8 hardware_ver[30];//硬件版本号
	uint8 software_ver[20];//软件版本号
	
	//uint8 remoteupdate[186];
};
struct t_up_remote_updatestart_ack//远程升级启动命令接收结果
{
	uint8 devnum[8];
	uint8 flag;
};
struct t_up_chargingdata//充电过程中上传数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 trade_num[16];
	uint16 business_type;
	uint8 user_id[8];
	uint8 cardno[8];
	uint8 begintime[7];
	uint8 endtime[7];
	uint32 tip_begin;
	uint32 tip_end;
	uint32 peak_begin;
	uint32 peak_end;
	uint32 normal_begin;
	uint32 normal_end;
	uint32 valley_begin;
	uint32 valley_end;
	uint32 tip_power;
	uint32 peak_power;
	uint32 normal_power;
	uint32 valley_power;
	uint32 total_power;
	uint32 tip_eleccost;
	uint32 peak_eleccost;
	uint32 normal_eleccost;
	uint32 valley_eleccost;
	uint32 total_eleccost;
	uint32 total_servercost;
	uint32 total_positioncost;
	uint16 cal_type;
	uint32 total_begin;
	uint32 total_end;
	uint8 timesharing_flag;
	uint8 vin[17];
	uint16 total_time;
	uint16 remain_time;
	uint32 total_cost;
	uint8 orderno[8];
};
struct t_down_chargingdata_ack//充电过程中上传确认数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 cardno[8];
	uint32 pay_money;
	uint32 user_money;
  uint8 flag;
	uint16 failreason;
	uint32 pay_km;
	uint32 remain_km;
	uint32 pay_power;
	uint32 remain_power;
	uint32 pay_cnt;
	uint32 remain_cnt;
};
struct t_down_reportpara_set//充电设备数据上报参数设置
{
	uint8 devnum[8];
	uint8 gunno;
	uint16 interval_datarep;
	uint16 interval_minrep;
	uint16 interval_keeplive;
	uint8  ip[4];
	uint16 port;
};
struct t_up_reportpara_set_ack//充电设备数据参数设置结果
{
	uint8 devnum[8];
	uint8 gunno;
    uint8 flag;
};
struct t_down_sm4update//SM4加密密钥更新
{
	uint8 devnum[8];
	uint8 sm4[16];
};
struct t_up_sm4update_ack//SM4密钥更新结果
{
	uint8 devnum[8];
	uint8 flag;
};
struct t_down_remote_startresult_ack//远程启动充电执行结果确认
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 flag;
};
struct t_down_remotecall_record//远程召唤充电记录
{
	uint8 devnum[8];
	uint8 trade_num[16];
	uint8 orderno[8];
};
struct t_up_remotecall_record_ack//远程召唤充电记录结果
{
	uint8 devnum[8];
	uint8 trade_num[16];
	uint8 orderno[8];
	uint8 flag;
};
struct t_down_remoteup_userreamin//远程更新用户帐户余额
{
	uint8 devnum[8];
	uint8 gunno;
    uint8 user_id[8];
	uint32 remain;
};
struct t_up_remoteup_userreamin_ack//远程更新用户帐户余额结果
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 user_id[8];
	uint8 flag;
};
struct t_down_remotecall_devrtc//远程召唤充电充电桩时钟
{
  uint8 devnum[8];
};

struct t_up_remotecall_devrtc_ack//远程召唤充电桩时钟结果
{
	uint8 devnum[8];
	uint8 flag;
    uint8 devrtc[7];
};
struct t_up_vinauth//vin鉴权数据
{
	uint8 devnum[8];
	uint8 gunno;
	uint8 password[16];
	uint8 vin[32];
};
struct t_down_vinauth//vin鉴权下行数据
{
	uint8 devnum[8];
	uint8 gunno;
  uint8 vin[32];
	uint8 costmode[8];
	uint32 user_remain;
	uint8 flag;
  uint16 fail_reason;	
	uint32 remain_km;
	uint32 avalib_power;
	uint32 remain_cnt;
	uint8 orderno[8];
};
struct t_down_remotecall_devpara//远程召唤设备参数
{
	uint8 devnum[8];
	uint8 gunnno;
};
struct t_up_remotecall_devpara_ack//远程召唤设备参数结果
{
	uint8 devnum[8];
	uint8 gunno;
	uint16 interval_datarep;
	uint16 interval_min;
	uint16 interval_keeplive;
	uint8 ip[4];
	uint16 port;
	uint8 hardwarever[30];
	uint8 softver[20];
	uint8 ercode[200];
};
struct t_down_remote_set_ercode//远程设置二维码
{
    uint8 devnum[8];
    uint8 gunno;
    uint8 ercode[200];	
};
struct t_up_remote_set_ercode_ack//远程设置二维码结果
{
    uint8 devnum[8];
	uint8 gunno;
	uint8 flag;
};
struct t_down_remotecall_devcostmode//远程召唤充电桩计费模型参数
{
   uint8 devnum[8];
   uint8 gunno;
   
};
struct t_up_remotecall_devcostmode_ack//远程召唤充电桩计费模型参数结果
{
   uint8 devnum[8];
   uint8 gunno;
   uint8 mode_id[8];
   uint8 begin_time[7];
   uint8 end_time[7];
   uint16 state;
   uint16 type;
   uint8 cnt;
   
};
struct t_down_remotecall_mediafile//远程召唤广告桩媒体文件
{
   uint8 devnum[8];
};
struct t_up_remotecall_mediafile_ack//远程召唤广告桩媒体文件结果
{
    uint8 devnum[8];
    uint16 total;
};
struct t_down_boardup_configfile//下发播放配置方案下行文件
{
    uint8 devnum[8];
	uint8 config_id;
	uint8 begin_time[7];
	uint8 end_time[7];
	uint8 cnt;
};
struct t_up_boardup_configfile_ack//下发播放配置方案下行数据结果
{
    uint8 devnum[8];
	uint8 config_id[8];
	uint8 flag;
    uint8 failreason;
};
struct t_down_remotecall_boardup_configfile//远程召唤广告桩媒体播放配置方案
{
   uint8 devnum[8];
};
struct t_up_remotecall_boardup_configfile_ack//远程召唤广告桩媒体播放配置方案结果
{
   uint8 devnum[8];
   uint8 config_id[8];
   uint8 begin_time[8];
   uint8 end_time[8];
   uint8 cnt;
};
struct t_down_remotecall_boardup_cnt//远程召唤广告桩媒体文件播放统计
{
    uint8 devnum[8];
	uint8 check_type;
	uint8 begin_time[7];
	uint8 end_time[7];
	uint8 file_name[10];
};
struct t_up_remotecall_boardup_cnt_ack//定时上报广告桩媒体文件播放统计结果
{
   uint8 devnum[8];
   uint8 total;
};
struct t_down_remote_enable//远程使能控制
{
    uint8 devnum[8];
	uint8 gunno;
	uint8 command;
};
struct t_up_remote_enable_ack//远程使能控制结果
{
    uint8 devnum[8];
	uint8 gunno;
	uint8 flag;
};
struct t_up_alarm_data//告警/故障信息上行数据
{
    uint8 devnum[8];
	uint8 gunno;
	uint8 alarm_object;
	uint8 alarm_time[7];
	uint8 alarm_state;
	uint16 alarm_code;
	uint16 diy_alarmreason_size;
	
};
struct t_down_alarm_data_ack//告警/故障信息下行数据
{
    uint8 devnum[8];
	uint8 gunno;
	uint8 flag;
};

struct t_ac_devyx//交流遥信数据
{
   	uint8 connect_state;
	uint8 ac_input_v_overalarm;
	uint8 ac_input_v_lowlarm;
	uint8 current_overalarm;
	uint8 output_relay_state;
	uint8 temp_over_pro;
	uint8 short_circuit_pro;
	uint8 leakage_pro;
	uint8 stopbutton_trigger;
};

struct t_ac_devyc_halfword//交流遥测数据(等于两字节的)
{
  uint16 work_state;
	uint16 output_voltage;
	uint16 output_current;
	uint16 voltage_A;
	uint16 voltage_B;
	uint16 voltage_C;
	uint16 current_A;
	uint16 current_B;
	uint16 currenr_C;	
};

struct t_ac_devyc_morehalfword//交流遥测数据(大于两字节的)
{
   uint32 total_actually_power;
   uint32 elecvalue_outside;
};

struct t_pal_alarm
{
	uint8 cnt;
	uint8 alarminfo[20][5];
};


#endif











